﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ZJCQ
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ZJCQ;

    class ZJ_extract_detail_map : EntityMapping<ZJ_extract_detail>
    {
        public ZJ_extract_detail_map()
        {
            Property(x => x.is_selected, map =>
            {
                map.Column(ZJ_extract_detail.Columns.is_selected);
            });

            Property(x => x.order_flag, map =>
            {
                map.Column(ZJ_extract_detail.Columns.order_flag);
            });

            Property(x => x.un_selected_msg, map =>
            {
                map.Column(ZJ_extract_detail.Columns.un_selected_msg);
            });

            Property(x => x.zj_company, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_company);
            });

            Property(x => x.zj_idcard_number, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_idcard_number);
            });

            Property(x => x.zj_mail_address, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_mail_address);
            });

            Property(x => x.zj_mobile, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_mobile);
            });

            Property(x => x.zj_name, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_name);
            });

            Property(x => x.zj_position, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_position);
            });

            Property(x => x.zj_professional, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_professional);
            });

            Property(x => x.zj_sex, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_sex);
            });

            Property(x => x.zj_tele_home, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_tele_home);
            });

            Property(x => x.zj_tele_work, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_tele_work);
            });

            Property(x => x.zj_title, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_title);
            });

            Property(x => x.zj_type_name, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_type_name);
            });

            Property(x => x.zj_category_names, map =>
            {
                map.Column(ZJ_extract_detail.Columns.zj_category_names);
            });

            //与抽取记录关联
            ManyToOne(x => x.extract, map =>
            {
                map.Column(ZJ_extract_detail.Columns.extract_id);
            });

            //与专家记录关联
            ManyToOne(x => x.expert, map =>
            {
                map.Column(ZJ_extract_detail.Columns.expert_id);
            }); 

            Table(ZJ_extract_detail.TableName);
        }
    }
}
